<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .red {
            color: red;
        }
        .gray {
            color: gray;
        }
        input {
            border: 1px solid green;
        }
        .error {
            color: pink;
            font-size: 12px;
            margin-left: 10px;
        }
    </style>
</head>
<body>
    <h1>添加学生</h1>
    <form action="" method="post">
        {% csrf_token %}
        {% for field in form %}
        <div>
            {% if field.field.required %}
            <span class="red">*</span>
            {% endif %}
            <label class="gray">{{ field.field.label }}</label>
            {{ field }}
            {% for error in field.errors %}
            <p class="error">{{ error }}</p>
            {% endfor %}
        </div>
        {% endfor %}
        <div>
            <button type="submit">添加学生</button>
        </div>
    </form>
</body>
</html>
